<?php
/**
 * User: aka
 * Time: 0:21
 */

namespace app\tenno\controller;


use think\facade\Session;
use think\Request;

class Mod
{
    public function index()
    {
        $modList = \app\tenno\model\Mod::index(0)
            ->paginate(10)
            ->each(
                function($item)
                {
                    $item->uid = \app\tenno\model\Users::userInfo($item->uid)
                    ->find();
                }
            );
        return view('index', ['mod_list' => $modList]);
    }

    public function sendMod()
    {
        return view('send_mod');
    }

    public function editMod(Request $request)
    {
        $id = base64_decode($request->param('id'));
        $oldData = \app\tenno\model\Mod::get($id);
        return view('edit_mod',['data' => $oldData]);
    }
}